﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using InventoryProject.FrameWork;
using System.Data;

namespace InventoryProject
{
    public partial class Login : System.Web.UI.Page
    {
        UserAccess _access;
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            _access = new UserAccess();
            DataTable dtData = new DataTable();
            string username, password, language;
            username = txtUsername.Text;
            password = txtPassword.Text;

            dtData = _access.CheckLogin(username, password);
            if (dtData.Rows.Count > 0 && dtData.Rows[0][0].ToString() == "OK")
                Response.Redirect("Default.aspx");
        }
    }
}